/****************************************************************************
**
** Character.cpp
**
** Copyright (C) August 2014 Hotride
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
*****************************************************************************
*/
//---------------------------------------------------------------------------
#include "stdafx.h"
//---------------------------------------------------------------------------
TCharacter::TCharacter(TGameObject *player)
: m_Str(0), m_Int(0), m_Dex(0), m_MaxMana(0), m_MaxStam(0),
m_Mana(0), m_Stam(0), m_MaxWeight(0), m_Weight(0), m_Armor(0), m_Gold(0),
m_Warmode(false)
{
	m_Player = player;
	m_Skills = new TSkill[UO->m_SkillsCount];
}
//---------------------------------------------------------------------------
TCharacter::~TCharacter()
{
	m_Player = NULL;
	delete []m_Skills;
}
//---------------------------------------------------------------------------
void TCharacter::SetSkillBaseValue(int index, float val)
{
	if (index < 0 || index >= UO->m_SkillsCount) return;
	m_Skills[index].SetBaseValue(val);
}
//---------------------------------------------------------------------------
void TCharacter::SetSkillValue(int index, float val)
{
	if (index < 0 || index >= UO->m_SkillsCount) return;
	m_Skills[index].SetValue(val);
}
//---------------------------------------------------------------------------
void TCharacter::SetSkillCap(int index, float val)
{
	if (index < 0 || index >= UO->m_SkillsCount) return;
	m_Skills[index].SetCap(val);
}
//---------------------------------------------------------------------------
void TCharacter::SetSkillStatus(int index, BYTE val)
{
	if (index < 0 || index >= UO->m_SkillsCount) return;
	m_Skills[index].SetStatus(val);
}
//---------------------------------------------------------------------------
float TCharacter::GetSkillBaseValue(int index) const
{
	if (index < 0 || index >= UO->m_SkillsCount) return 0.0f;
	return m_Skills[index].GetBaseValue();
}
//---------------------------------------------------------------------------
float TCharacter::GetSkillValue(int index) const
{
	if (index < 0 || index >= UO->m_SkillsCount) return 0.0f;
	return m_Skills[index].GetValue();
}
//---------------------------------------------------------------------------
float TCharacter::GetSkillCap(int index) const
{
	if (index < 0 || index >= UO->m_SkillsCount) return 0.0f;
	return m_Skills[index].GetCap();
}
//---------------------------------------------------------------------------
BYTE TCharacter::GetSkillStatus(int index) const
{
	if (index < 0 || index >= UO->m_SkillsCount) return 0;
	return m_Skills[index].GetStatus();
}
//---------------------------------------------------------------------------